home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1995 #2
/
Amiga Plus CD - 1995 - No. 2.iso
/
pd
/
disktools
/
filer
/
rexx
/
ttar.filer
< prev
next >
Wrap
Text File
|
1995-04-11
|
4KB
|
149 lines
/*
$VER: TTar.filer 1.1 (26.11.93)
Author:
Michael Böhnisch (billy@uni-paderborn.de) (mb)
Function:
Basic Tar/SCSI Tape interface for Filer. Combined with BTN
Tape handler, "tape.filer" and tar (included in BTN
distrib.) it's very easy to make Filer act as a simple
backup program.
Requires:
BTN Handler installed (from Fish Disk #558)
tar (from BTN distribution)
Streamer device
Call:
TTar READ Tape tar archive --> selected directory
TTar WRITE Selected files/dirs --> Tape tar archive
TTar LIST List tape tar archive
TTar DIFF Compare tape tar archive <--> selected dir
Example for Filer.RC:
XBUTTON 2,0,0,5,">>> Tape","TTar WRITE"
XBUTTON 2,1,0,5,"Tape >>>","TTar READ"
XBUTTON 2,2,0,7,"List","TTar LIST"
XBUTTON 2,3,0,1,"Verify","TTar DIFF"
(see also "tape.filer")
History:
23.09.93 1.0 Initial Release (mb)
26.11.93 1.1 Review for Filer 3.10 Gamma 2 (mb)
*/
PARSE ARG Cmd
OPTIONS RESULTS /* aquire results */
ADDRESS 'FilerRexx' /* default to Filer's ReXX port */
PANEL OFF /* switch command buttons off */
tmpfile = "T:ToTape.filer.tmp"
quote = "22"X
condev = "CON:"
size = "0/16/680/384/"
title = "TTar output press CTRL-C to abort"
GETSCREENNAME
IF RESULT = "RESULT" THEN EXIT 5
screen = RESULT
flags = "/AUTO/CLOSE/SCREEN" || screen
winfile = quote || condev || size || title || flags || quote
ALERTBOX "Please insert medium into tape drive!"
SELECT
/* ------------------------------------------------------------------ */
/* Read Tar archive from Tape to selected directory */
/* ------------------------------------------------------------------ */
WHEN Cmd = 'READ' THEN DO
GETSOURCEPATH
IF RESULT = 'RESULT' THEN EXIT 5
dir = RESULT
PRAGMA('D', dir)
GETNUMENTRIES
IF RESULT = 'RESULT' THEN EXIT 5
Anzahl = RESULT
SHELL COMMAND "Tar xvR >" winfile
UPDATESOURCEDIR
HISTORY "TTar: Tar Archiv extracted to" dir
END
/* ---------------------------------------------------------------- */
/* Write selected files/archives from source directory to Tape tar */
/* archive */
/* ---------------------------------------------------------------- */
WHEN Cmd = 'WRITE' THEN DO
GETSOURCEPATH
IF RESULT = 'RESULT' THEN EXIT 5
dir = RESULT
PRAGMA('D', dir)
GETNUMENTRIES
IF RESULT = 'RESULT' THEN EXIT 5
Anzahl = RESULT
OPEN('TMP', tmpfile, 'WRITE')
DO i = 1 TO Anzahl
GETNAME i
IF RESULT = 'RESULT' THEN EXIT 5
Eintrag = RESULT
Type = LEFT(Eintrag, 1) /* parse filetype (f, d, F, D) */
Name = SUBSTR(Eintrag, 2) /* parse filename */
IF Type = 'd' | Type = 'f' THEN DO
WRITELN('TMP', Name)
TOGGLEENTRY i
HISTORY "TTar: adding" Name "to TAPE tar archive"
END
END
CLOSE('TMP')
SHELL COMMAND "Tar cvRT" tmpfile ">" winfile
SHELL COMMAND "Delete" tmpfile
END
/* ---------------------------------------------------------------- */
/* List files in tar Tape archive */
/* ---------------------------------------------------------------- */
WHEN Cmd = 'LIST' THEN DO
SHELL COMMAND "Tar tvR >" winfile
END
/* ---------------------------------------------------------------- */
/* Compare tar archive to filesystem data */
/* ---------------------------------------------------------------- */
WHEN Cmd = 'DIFF' THEN DO
GETSOURCEPATH
IF RESULT = 'RESULT' THEN EXIT 5
dir = RESULT
PRAGMA('D', dir)
SHELL COMMAND "Tar dvR >" winfile
END
/* ---------------------------------------------------------------- */
/* Just in case someone calls this from Shell/CLI */
/* ---------------------------------------------------------------- */
OTHERWISE DO
SAY "Use from Filer® only!"
END
END
PANEL ON